
// 程序入口
class GameMain {
    constructor() {
        FrameworkConst.width = 640;
        FrameworkConst.height = 1136;
        Laya.MiniAdpter.init();
        Laya.init(FrameworkConst.width, FrameworkConst.height);

        //加载资源 可以加载图集数组
        var resArray = [
            { url: "res/atlas/map/main_bg/shaizi.atlas", type: Laya.Loader.ATLAS },
            { url: "res/atlas/map/main_bg.atlas", type: Laya.Loader.ATLAS },
            { url: "res/atlas/map/main_gameimage.atlas", type: Laya.Loader.ATLAS },
            { url: "res/atlas/map/main_gameimage1.atlas", type: Laya.Loader.ATLAS },
            { url: "res/atlas/map/title_gameimage.atlas", type: Laya.Loader.ATLAS },
        ];
        Laya.loader.load(resArray, Laya.Handler.create(this, this.onLoaderComplete),
            Laya.Handler.create(this, this.onProgress));
    }

    /**
     * 加载进度
     * 
     * @param {number} value 
     * @memberof GameMain
     */
    onProgress(value: number): void {
        console.log("资源文件加载进度: %s%", value);
    }


    /**
     *  加载完成
     * 
     * @memberof GameMain
     */
    onLoaderComplete(): void {
        console.log("资源文件加载完成");
        var bg: bgScene = new bgScene();
    }
}
new GameMain();